import os
from dotenv import load_dotenv

class Config:
    def __init__(self):
        load_dotenv()
        
        # Model Configuration
        self.model_config = {
            'input_size': 24,
            'hidden_size': 128,
            'num_layers': 2,
            'output_size': 1,
            'dropout': 0.2
        }
        
        # Training Configuration
        self.train_config = {
            'batch_size': 32,
            'epochs': 100,
            'learning_rate': 0.001,
            'early_stopping_patience': 10
        }
        
        # Data Configuration
        self.data_config = {
            'train_split': 0.7,
            'val_split': 0.15,
            'test_split': 0.15,
            'sequence_length': 24,
            'prediction_length': 1
        }
        
        # Paths
        self.model_save_path = os.getenv('MODEL_SAVE_PATH', 'models/saved')
        self.data_path = os.getenv('DATA_PATH', 'data/raw')
        self.processed_data_path = os.getenv('PROCESSED_DATA_PATH', 'data/processed')
        
        # Logging Configuration
        self.log_level = os.getenv('LOG_LEVEL', 'INFO')
        self.log_file = os.getenv('LOG_FILE', 'logs/app.log')
        
    @property
    def device(self):
        """Get the device for training (CPU/GPU)"""
        import torch
        return torch.device('cuda' if torch.cuda.is_available() else 'cpu')